package com.example.park_2306.fg

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.recyclerview.widget.RecyclerView

class VideoRecyclerView:RecyclerView {
    //设置标志位
    private var flag = true
    fun setFlag1(newFlag:Boolean){
        flag = newFlag
    }
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    override fun onInterceptTouchEvent(e: MotionEvent?): Boolean {
        return if(flag){
            super.onInterceptTouchEvent(e)
        }else{
            false
        }

    }

}